import Vue from 'vue'
import Vuex from 'vuex'
import storage from '../util/storage'
Vue.use(Vuex)

const state = {
    token: null,
    tabid: 1,
    print: {
        id: '',
        list: null,
        remarks: null
    },
    userinfo:storage.localGet('userinfo'),
}
const mutations = {
    codeTips(state,msg) {
        state.token = msg.logincode;
        state.userinfo = msg
    },
    tabTips(state,msg){
        state.tabid = msg
    },
    printTips(state,msg){
        state.print.id = msg.id;
        state.print.list = msg.list;
        state.print.remarks = msg.remarks;
    }
}
export default new Vuex.Store({
    state,
    mutations
})